package com.gsm.controller;

import com.gsm.entity.Result;
import com.gsm.service.WebCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("web-course")
public class WebCourseController {
    @Autowired
    private WebCourseService webCourseService;

    /**
     * 根据 课程id 查询章节和课程列表
     */
    @GetMapping("chapters/courses/{subjectId}")
    public Result selectChaptersCoursesBySubjectId(@PathVariable("subjectId")Long subjectId) {
        Result result = webCourseService.selectChaptersCoursesBySubjectId(subjectId);
        return result;
    }
}
